

# 1-1000这些数字
# lst=[]
# for i in range(0,1001):
#     lst.append(i)
# print(lst)

# 列表推导式
lst = [i for i in range(1,1000)]
print(lst)

# 使用列表推导完成1-10 【1， 4， 9， 16， 25】
n=[i*i for i in range(1,11)]
#
lst = list(range(1, 10))
print(lst)

lst = [("name", "zhangsan"), ("age", 10), ('weight', 50)]
# dic = {
#     "name": 'zhangsan',
#     "age": 10,
#     "weight": 100
# }
# dic = {}
# for k, v in lst:
#     dic[k] = v
# print(dic)

# 字典推导式
dic = {k: v for k, v in lst}
print(dic)